﻿@using KMF.Common
@using KMF.WebUI.Areas.KMFadmin.CustomHelpers
@using KMF.WebUI.Areas.KMFadmin.Models
@model BannerDto
@{
    ViewBag.Title = "AddBanner";
    Layout = "~/Areas/KMFadmin/Views/Shared/_layout.cshtml";
}

<link href="~/Areas/KMFadmin/Content/css/browerImage.css" rel="stylesheet" />
<link href="~/Areas/KMFadmin/Scripts/jQueryDatePicker/css/ui-lightness/jquery-ui-1.10.1.custom.min.css" rel="stylesheet" />
<link href="~/Areas/KMFadmin/Scripts/jQueryDatePicker/js/jquery-ui-timepicker-addon.css" rel="stylesheet" />

<nav>
    <div id="jCrumbs" class="breadCrumb module">
        <ul>
            <li><a href="@Url.Action("Index","AdminHome")"><i class="bootstrap icon-home"></i></a></li>
            <li><a href="javascript:void(0)">Thêm Banner</a> </li>
        </ul>
    </div>
</nav>

<div class="toolBox">
    @Html.ToolBox(new List<object> { new Add { ClassCss = "Add", ActionName = "Javascript:void(0)" } ,
    new Back{ ClassCss = "Back",ActionName = @Url.Action("Index","AdminBanner") } })
</div>

@using (Html.BeginForm("AddBanner", "AdminBanner", FormMethod.Post))
{
    <div class="box-Info">
        <div class="Info-header">
            <span>Thêm Banner mới</span>
        </div>

        <div class="Info-body ib-infopro">
            <div>@Html.ValidationMessage("ErrorSummary")</div>
            <table cellpadding="0" cellspacing="0" width="100%" border="0" class="table-info">
                <tr>
                    <td class="tInfoLeft">Tên banner
                    </td>
                    <td class="tInfoRight">
                        @Html.TextBoxFor(m => m.Subject)
                        @Html.ValidationMessageFor(m => m.Subject)
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Thuộc Trang
                    </td>
                    <td class="tInfoRight">
                        @Html.DropDownListFor(m => m.PageId, new SelectList((List<PageDto>)ViewBag.PageList, "PageId", "Name"))
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Vị trí
                    </td>
                    <td class="tInfoRight">
                        @Html.DropDownListFor(m => m.PositionId, new SelectList((List<PositionDto>)ViewBag.PositionList, "PositionId", "Name"))
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">
                        Thuộc danh mục
                    </td>
                    <td class="tInfoRight">
                        @Html.DropDownListFor(m => m.CategoryId, new SelectList((List<ProductCategoryDto>)ViewBag.MenuList, "Id", "Name"))
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Kích hoạt
                    </td>
                    <td class="tInfoRight">
                        @Html.CheckBoxFor(m => m.Active)
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Ngày bắt đầu
                    </td>
                    <td class="tInfoRight">
                        @Html.TextBoxFor(m => m.StartDate, new { @style = "width:150px;" })
                        @Html.ValidationMessageFor(m => m.StartDate)
                    </td>
                </tr>
                <tr>
                    <td class="tInfoLeft">Ngày kết thúc
                    </td>
                    <td class="tInfoRight">
                        @Html.TextBoxFor(m => m.ExpireDate, new { @style = "width:150px;" })
                        @Html.ValidationMessageFor(m => m.ExpireDate)
                    </td>
                </tr>
            </table>
        </div>
    </div>
}

@section scripts
{    
    @Scripts.Render("~/bundles/KMFAdmin/jqueryval")
    <script src="@Url.Content("~/Areas/KMFadmin/Scripts/jQueryDatePicker/js/jquery-ui-1.10.1.custom.min.js")"></script>
    <script src="@Url.Content("~/Areas/KMFadmin/Scripts/jQueryDatePicker/js/jquery-ui-timepicker-addon.js")"></script>
   
    <script>
        SubmitFormUseToolBox($('ul li.Add a'), $('form'));
        
        // ------------- Date picker -------
        $('#StartDate').datetimepicker({ dateFormat: 'dd/mm/yy', timeFormat: "hh:mm:ss tt" });
        $('#ExpireDate').datetimepicker({ dateFormat: 'dd/mm/yy', timeFormat: "hh:mm:ss tt" });
    </script>
}
